<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>公告详情</title>
		<meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport" />
		<meta content="yes" name="apple-mobile-web-app-capable" />
		<meta content="black" name="apple-mobile-web-app-status-bar-style" />
		<meta content="telephone=no" name="format-detection" />
		<!-- 引入YDUI样式 -->
		<link rel="stylesheet" href="../build/css/ydui.css" />
		<link rel="stylesheet" href="../css/common.css" />
		<link rel="stylesheet" href="../css/fontcss/css/font-awesome.min.css" />
		<script src="../js/jq331.min.js"></script>
		<!-- 引入YDUI自适应解决方案类库 -->		
		<style>
			.content{
				padding: .2rem;
			}
			.title{
				padding: .15rem 0;
				font-size: .5rem;
				font-family: '楷体';
				text-align: center;
			}
			.time{
				color: #898989;
				padding: .2rem 0;
				display: inline-block;
			}
			.main-text p{
				text-indent: 2em;
				display: block;
				line-height: .5rem;
			}
			img{
				max-width: 100%;
			}
		</style>
	</head>
	<body>
		<div class="logincantion">
			<header class="m-navbar">
				<a href="#" onClick="javascript :window.history.back(); return false;" class="navbar-item">
					<i class="back-ico"></i>
				</a>
				<div class="navbar-center">
					<span class="navbar-title">公告详情</span>
				</div>
			</header>
			<div class="content">
				<p class="title"></p>
				<label class="time"></label>
				<span class="main-text"></span>
			</div>
			<!-- 报备客户按钮 -->
			<a href="reportecustomers/index.html?name=2">
				<div id="preparation">报备</div>
			</a>
		</div>
	</body>
	<script>
		$(document).ready(function(){
			var noticedetailsApi = commapi + "notice/content";
			var id =  params.id; //获取地址栏的id
			var dataToken = localStorage.getItem('token'); // 获取token
			if(!dataToken){				
				!function (win, $) {
					var dialog = win.YDUI.dialog;
					/* 加载中提示框 */									
						dialog.loading.open('登录超时，跳转中...');
						setTimeout(function () {
							dialog.loading.close();/* 移除loading */
							localStorage.removeItem('token'); //清除token
							location.href="./login.html";
						}, 2000);
				
				}(window, jQuery);								
				return;
			}
			//公告详情
				$.ajax({
					url : noticedetailsApi,
					type : "get",
					async:false,
					data: {'id': id},
					success : function(result) {
						$('.content').find('.title').html(result.title);
						$('.content').find('.time').html(result.update_time);
						$('.content').find('.main-text').html(result.content);
					},
					error:function(msg){
							console.log(msg) // 失败返回
					}
				});
		});
	</script>
	<script src="../build/js/ydui.flexible.js"></script>
	<!-- 引入YDUI脚本 -->
	<script src="../build/js/ydui.js"></script>
	<script src="../js/common.js"></script>
	<script src="../js/login.js"></script>
</html>
